/*****************************************************************
 *   Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 ****************************************************************/
package org.epiphron.domain;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.epiphron.convert.Id;
import org.epiphron.convert.RdfProperty;

public class Car {
	@RdfProperty("hasDoor")
	List<Door> doors;
	String brand;
	double engineCapacity;
	double power;
	
	@RdfProperty("hasSameBrand")
	List<Car> sameBrandCars;
	
	@RdfProperty("fasterThan")
	List<Car> slowerCars;
	
	@RdfProperty("slowerThan")
	List<Car> fasterCars;
	
	@RdfProperty("newerThan")
	List<Car> olderCars;
	
	@Id
	String vin;
	
	public Car(String _vin) {
		doors = new ArrayList<Door>();
		sameBrandCars = new ArrayList<Car>();
		slowerCars = new ArrayList<Car>();
		fasterCars = new ArrayList<Car>();
		olderCars = new ArrayList<Car>();
		
		vin = _vin;
		
		sameBrandCars.add(this);
	}
	
	public void addDoor(Door door) {
		doors.add(door);
	}
	
	public void removeDoor(Door door) {
		doors.remove(door);
	}
	
	public List<Door> getDoors() {
		return Collections.unmodifiableList(doors);
	}
	
	public void addSameBrandCar(Car car) {
		sameBrandCars.add(car);
	}
	
	public void removeSameBrandCar(Car car) {
		sameBrandCars.remove(car);
	}
	
	public List<Car> getSameBrandCars() {
		return Collections.unmodifiableList(sameBrandCars);
	}
	
	public void addSlowerCar(Car car) {
		slowerCars.add(car);
	}
	
	public void removeSlowerCar(Car car) {
		slowerCars.remove(car);
	}
	
	public List<Car> getSlowerCars() {
		return Collections.unmodifiableList(slowerCars);
	}
	
	public void addFasterCar(Car car) {
		fasterCars.add(car);
	}
	
	public void removeFasterCar(Car car) {
		fasterCars.remove(car);
	}
	
	public List<Car> getFasterCars() {
		return Collections.unmodifiableList(fasterCars);
	}
	
	public void addOlderCar(Car car) {
		olderCars.add(car);
	}
	
	public void removeOlderCar(Car car) {
		olderCars.remove(car);
	}
	
	public List<Car> getOlderCars() {
		return Collections.unmodifiableList(olderCars);
	}
	
	public String getBrand() {
		return brand;
	}
	
	public void setBrand(String brand) {
		this.brand = brand;
	}
	
	public double getEngineCapacity() {
		return engineCapacity;
	}
	
	public void setEngineCapacity(double engineCapacity) {
		this.engineCapacity = engineCapacity;
	}
	
	public double getPower() {
		return power;
	}
	
	public void setPower(double power) {
		this.power = power;
	}
}
